package com.kimho.notice.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.kimho.core.PageInfo;
import com.kimho.notice.domain.Notice;
import com.kimho.notice.persistence.NoticeMapper;

@Service
public class NoticeService {
	
	@Autowired
	private NoticeMapper noticeMapper;
	
	public Long getTotalCount(){
		return this.noticeMapper.getTotalCount();
	}
	
	public List<Notice> getAllNotice(PageInfo pi){
		return this.noticeMapper.getAllNotice(pi);
	}
	@Transactional
	public void saveNotice(Notice notice){
		this.noticeMapper.saveNotice(notice);
	}
	@Transactional
	public void updateNotice(Notice notice){
		this.noticeMapper.updateNotice(notice);
	}
	
	public String getMessageById(String noticeId){
		return this.noticeMapper.getMessageById(noticeId);
	}
	public void delNotice(String noticeId){
		 this.noticeMapper.delNotice(noticeId);
	}
}
